<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>数据占位符定义规范 DPD</title>
</head>

<body>
    <script src="https://cdn.bootcdn.net/ajax/libs/Mock.js/1.0.1-beta3/mock-min.js"></script>
    <h2>数据模版定义规范-数据占位符定义规范 DPD</h2>
    F12打开控制台查看更方便
    <div class="box">
        展示内容:<div id="content"></div>
    </div>
    <script>
        //生成数据
        let Random = Mock.Random;
        // Random.cword( pool, length )
        //Random.cword('零一二三四五六七八九十', 3)
        //Mock.mock('@cword("零一二三四五六七八九十", 3)')

        let list = Mock.mock({
            name: {
                first: '@FIRST',
                middle: '@FIRST',
                last: '@LAST',
                full: '@first @middle @last',
                自定义: '@cword("零一二三四五六七八九十", 3)',
            }
        })
        //展示数据
        console.table(list)
        x = document.getElementById("content");
        //将对象转为JSON
        x.innerHTML = JSON.stringify(list, null, '<br />');

    </script>

</body>

</html>